#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <stdio.h>

void handler(int sig)
{
    printf("ctrl +c pressed\n");

    signal(SIGINT,SIG_DFL);
    raise(SIGINT);
}

int main(int argc,char const* argv[])
{
//    kill(getpid(),SIGKILL);
//    raise(SIGKILL);

//    printf("%d\n",alarm(5));
//    sleep(1);
//    printf("%d\n",alarm(4));

//    pause();

    signal(SIGINT,SIG_IGN);
    signal(SIGINT,handler);

    while (1)
    {
         pause();
    }

    return 0;
}